/*
 * Route CLASS TEMPLATE
 *
 */

#ifndef UNITRAF_ROUTE_HPP
#define UNITRAF_ROUTE_HPP

#include <graph\Common.hpp>

namespace unitraf {

  template<class _VertexDesc>
    class Route {
     
     public:
      /////////////////////////////////////////////////////////////////////////
      // PUBLIC INTERFACE

      typedef _VertexDesc vertex_descriptor;

      typedef list<vertex_descriptor> route_type;
      
      typedef typename route_type::const_iterator const_iterator;
      typedef typename route_type::const_reverse_iterator const_reverse_iterator;

      // CONSTRUCTORS AND INITALIZERS

      Route() {};

      // DESTRUCTOR

      ~Route() {};

      
      // METHODS

      // Add given vertex to the path (uses COPY semantic)
      void _add(const vertex_descriptor& vertex) {
        return path_.push_back(vertex);
      };

      // Add given vertex to the path (uses MOVE semantic)
      void _add(vertex_descriptor&& vertex) {
        return path_.push_back(vertex);
      };

      // Derive iterator for starting point of a path
      const_iterator _begin() const { return path_.begin(); };

      // Derive iterator for "starting" point of a reverse sequence
      const_reverse_iterator _rbegin() const { return path_.rbegin(); };

      // Derive iterator for past-the-ending-point of a path
      const_iterator _end() const { return path_.end(); };

      // Derive iterator for past-the-ending-point of a reverse sequence
      const_reverse_iterator _rend() const { return path_.rend(); };

      // Length of route/path
      size_t _length() const { return path_.size(); };

     private:
      /////////////////////////////////////////////////////////////////////////
      // REPRESENTATION
       
      route_type path_;

    };

};

#endif  // #ifndef UNITRAF_ROUTE_HPP